class Walk
{
public:
    Walk(const Node* n)
    {
        _nodes.Allocate(1, n);
    }
    
    Walk(Walk* w, const Node* n)
    {
        _nodes = w->_nodes;
        _nodes.PushEnd(n);
    }

    __forceinline Vector<const Node*>& nodes()
    {
        return _nodes;
    }

    __forceinline const Vector<const Node*>& nodes() const
    {
        return _nodes;
    }

    __forceinline String ToString() const
    {
        String result;
        for(UINT visitIndex = 0; visitIndex < _nodes.Length(); visitIndex++)
        {
            result += String(_nodes[visitIndex]->index);
            if(visitIndex != _nodes.Length() - 1)
            {
                result += ',';
            }
        }
        return result;
    }
private:
    Vector<const Node*> _nodes;
};